<%-- 
    Document   : movieList
    Created on : May 1, 2013, 5:39:55 PM
    Author     : DevSteve
--%>

<%@page import="java.util.List"%>
<%@page import="java.io.FileReader"%>
<%@page import="java.io.IOException"%>
<%@page import="java.io.BufferedReader"%>
<%@page import="java.io.InputStreamReader"%>
<%@page import="java.io.FileNotFoundException"%>
<%@page import="java.io.FileInputStream"%>
<%@page import="java.io.File"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.Connection"%>
<%@page import="db.DB"%>
<%@page import="db.MovieObj"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
        <title>Dataflix</title>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <meta http-equiv="content-language" content="en" />
        <meta name="description" content="" />
        <meta name="language" content="en" />
        <link type="text/css" rel="stylesheet" href="../css/style.css"/>
        <link type="text/css" rel="stylesheet" href="../css/style.css"/>
        <link type-="text/css" rel="stylesheet" href="../css/jquery-ui-1.9.2.custom.min.css"/>
        <link type-="text/css" rel="stylesheet" href="../css/timeline.css"/>
        <link type-="text/css" rel="stylesheet" href="../css/bootstrap.min.css"/>
        <style type="text/css">
            body {
                padding-bottom: 40px;
            }
            .sidebar-nav {
                padding: 9px 0;
            }
        </style>
        <script src="../js/jquery-1.9.1.min.js"></script>
        <script src="../js/jquery-ui-1.9.2.custom.min.js"></script>
        <script src="../js/bootstrap.min.js"></script>
        <script>
            
        </script>
        
    <head>
    <body>
        <%
            String userId = request.getParameter("userId");
        %>
        
                <table id="head">
                    <tr>
                        <td>
                            <a href="employee.jsp?userId=<%=userId %>" /><img style="margin-left:10%;" src="../images/logoadmin.png"/></a>
                        </td>

                        <td>
                            <table id="loginbox">
                                <tr>
                                    <td width="40%">
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <div class="bottom"></div>
                <div class="container-fluid">
            <h3>
                Customer Mailing List
            </h3>
            <table class="table">
            
                <% 

                java.sql.Connection con;
                java.sql.Statement s;
                java.sql.ResultSet rs;
                java.sql.PreparedStatement pst;

                con=null;
                s=null;
                pst=null;
                rs=null;

                DB data=new DB();
                

                
                String sql = "SELECT * FROM Users Where Authority=0";
                try{
                    con = data.getConnection();
                    s = con.createStatement();
                    rs = s.executeQuery(sql);
                %>
                <thead>
                <tr>
                <th width="80px;">Id</th>
                <th width="100px;">Last Name</th>
                <th width="100px;">First Name</th>
                <th width="120px;">Email</th>
                <th width="200px;">Address</th>
                <th width="100px;">City</th>
                <th width="80px;">State</th>
                <th width="120px;">Zip Code</th>
                </tr>
                </thead>
                
                <tbody id ="gridBody"> 
                <%
                while( rs.next() ){
                %><tr>
                <td><%= rs.getString("Id") %></td>
                <td><%=rs.getString("LastName") %></td>
                <td><%=rs.getString("FirstName") %></td>
                <td><%= rs.getString("Email") %></td>
                <td><%=rs.getString("Address")%></td>
                <td><%=rs.getString("City")%></td>
                <td><%=rs.getString("State")%></td>
                <td><%=rs.getString("ZipCode")%></td>
                </tr>
                <%
                }
                %>

                <%

                }
                catch(Exception e){e.printStackTrace();}
                finally{
                if(rs!=null) rs.close();
                if(s!=null) s.close();
                if(con!=null) con.close();
                }

                %>
                </tbody>
          </table>
        </div>
    <body>
</html>



